//
//  ViewController.m
//  UI07_HomeWork
//
//  Created by Bodi on 16/6/14.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"
#import "SecondViewController.h"
#import "GestureImageView.h"

@interface ViewController ()<CallDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"首页";
    [self createPicture];
    



}
- (void)createPicture{
    

    
 NSString *path1 = [[NSBundle mainBundle]pathForResource:@"1" ofType:@"jpg"];

    GestureImageView *gesture1 = [[GestureImageView alloc]initWithImage:[UIImage imageNamed:path1] withFrame:CGRectMake(70, 120, 100, 150)];
    [self.view addSubview:gesture1];
    
    [gesture1 release];
    
    
    
    
    NSString *path2 = [[NSBundle mainBundle]pathForResource:@"2" ofType:@"jpg"];
    GestureImageView *gesture2 = [[GestureImageView alloc]initWithImage:[UIImage imageNamed:path2] withFrame:CGRectMake(170, 120, 100, 150)];
    [self.view addSubview:gesture2];
    [gesture2 release];
    
    
    
    NSString *path3 = [[NSBundle mainBundle]pathForResource:@"3" ofType:@"jpg"];
    
    GestureImageView *gesture3 = [[GestureImageView alloc]initWithImage:[UIImage imageNamed:path3] withFrame:CGRectMake(70, 270, 100, 150)];
    [self.view addSubview:gesture3];
    [gesture3 release];
    
    
    
    NSString *path4 = [[NSBundle mainBundle]pathForResource:@"4" ofType:@"jpg"];
    GestureImageView *gesture4 = [[GestureImageView alloc]initWithImage:[UIImage imageNamed:path4] withFrame:CGRectMake(170, 270, 100, 150)];
    [self.view addSubview:gesture4];
    [gesture4 release];
    
    
    
    NSString *path5 = [[NSBundle mainBundle]pathForResource:@"5" ofType:@"jpg"];
    GestureImageView *gesture5 = [[GestureImageView alloc]initWithImage:[UIImage imageNamed:path5] withFrame:CGRectMake(70, 420, 100, 150)];
    [self.view addSubview:gesture5];
    [gesture5 release];
    
    
    NSString *path6 = [[NSBundle mainBundle]pathForResource:@"6" ofType:@"jpg"];
    GestureImageView *gesture6 = [[GestureImageView alloc]initWithImage:[UIImage imageNamed:path6] withFrame:CGRectMake(170, 420, 100, 150)];
    [self.view addSubview:gesture6];
    [gesture6 release];
    
    gesture1.delegate = self;
    gesture2.delegate = self;
    gesture3.delegate = self;
    gesture4.delegate = self;
    gesture5.delegate = self;
    gesture6.delegate = self;
    
    

    
}
- (void)call{
    SecondViewController *secondVC = [[SecondViewController alloc]init];
    /**此时secondVC被加入到navigationController的viewControllers数组中, 引用计数加一*/
    [self.navigationController pushViewController:secondVC animated:YES];
    [secondVC release];
    


}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
